<!DOCTYPE html>
<html lang="en">
<head>
    <title></title>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="../../css/bootstrap.min.css" />
    <link rel="stylesheet" href="../../css/bootstrap-responsive.min.css" />
    <link rel="stylesheet" href="../../css/fullcalendar.css" />
    <link rel="stylesheet" href="../../css/unicorn.main.css" />
    <link rel="stylesheet" href="../../css/unicorn.grey.css" class="skin-color" />
    <script src="../lib/jquery.min.js"></script>
    <script src="../lib/bootstrap.min.js"></script>
    <script src="../lib/angualrjs.min.js"></script>
</head>
<body bgcolor="buttonface">
<div id="header">
    <h1><a href="lambda.html">Area</a></h1>
</div>

<div id="sidebar">
    <ul id="uu">
        <li><a href="../../index.html">><i class="icon icon-th-list"></i> <span>TypeScript-Learn</span></a></li>
        <li><a href="hello.html">><i class="icon icon-th-list"></i> <span>Hello TypeScript</span></a></li>
        <li><a href="area.html">><i class="icon icon-th-list"></i> <span>Area</span></a></li>
        <li><a href="interface.html">><i class="icon icon-th-list"></i> <span>Interface</span></a></li>
        <li><a href="lambda.html">><i class="icon icon-th-list"></i> <span>lambda 表达式</span></a></li>
        <li><a href="class.html">><i class="icon icon-th-list"></i> <span>Class</span></a></li>
        <li><a href="extends.html">><i class="icon icon-th-list"></i> <span>Extends</span></a></li>
    </ul>
</div>

<div id="content">
    <div> <h1>按键F12，控制台将会打印如下内容</h1></div>
    <div><img src="../../img/demo/lambda.png"/></div>
    <div>
        <h2>箭头函数表达式（lambda表达式）</h2>
        <p>lambda表达式 <b>()=&gt;{something}或()=&gt;something </b> 相当于js中的函数,它的好处是可以自动将函数中的this附加到上下文中。</p>
    </div>
    <pre>
    <code class="lang-shell">
        var shape = {
        name: "rectangle",
        popup: function() {

        console.log('This inside popup(): ' + this.name);

        setTimeout( () => {
        console.log('This inside setTimeout(): ' + this.name);
        console.log("I'm a " + this.name + "!");
        }, 3000);

        }
        };

        shape.popup();
    </code>
        </pre>
</div>


<script src="lamdba.js"></script>
</body>
</html>
